from django.urls import reverse


def filter_reverse(request, url):
    filter_string = request.GET.get('_filter')
    url = reverse(url)
    if not filter_string:
        return url
    return f'{url}?{filter_string}'
